<html>
<body><br>
    <table class="mytable">
<tr>
    <th align="center">ID</th>
    <th align="center">Username</th>
    <th align="center">Order date</th>
    <th align="center">Receive date</th>
    <th align="center">Receiver name</th>
    <th align="center">Receiver address</th>
    <th align="center">Receiver phone</th>
    <th align="center">Total</th>
    <th align="center">&nbsp;</th>
</tr><tr>
<?php
if (count($this->paginator)):
    $user = new Account(); // for retrieve user name
    foreach ($this->paginator as $order):
?>
<tr>
    <td><?php echo $this->escape($order->id);?></td>
    <td><?php $row = $user->fetchRow('id='.$order->user_id); echo $this->escape($row->username);?></td>
    <td><?php echo $this->escape($order->order_date);?></td>
    <td><?php echo $this->escape($order->receive_date);?></td>
    <td><?php echo $this->escape($order->receiver_name);?></td>
    <td><?php echo $this->escape($order->receiver_address);?></td>
    <td><?php echo $this->escape($order->receiver_phone);?></td>
    <td><?php echo $this->escape($order->total);?></td>
    <td>
        <a href="<?php echo $this->url(array('controller'=>'order',
            'action'=>'update', 'id'=>$order->id));?>">Edit</a>
        <a href="<?php echo $this->url(array('controller'=>'order',
            'action'=>'delete', 'id'=>$order->id));?>">Delete</a>
    </td>
</tr>
<?php endforeach; echo "</tr></table>"; endif; ?><hr>
<?= $this->paginationControl($this->paginator,
                             'Sliding',
                             'pagination.phtml'); ?>
</body>
</html>